
import VueRouter from 'vue-router'

//后面要写xxx.vue，否则会报Module not found: Error: Can't resolve
//但在有些情况下.vue是可以省略的，
import Home from './components/tabbar/Home.vue'
import Member from './components/tabbar/Member.vue'
import Shopcar from './components/tabbar/Shopcar.vue'
import Search from './components/tabbar/Search.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import PhotoList from './components/photo/PhotoList.vue'
import PhotoInfo from './components/photo/PhotoInfo.vue'

// 定义vue-router对象

const router = new VueRouter({
	routes:[
		{path:'/',redirect:'/home'},
		{path:'/home',component:Home},
		{path:'/member',component:Member},
		{path:'/shopcar',component:Shopcar},
		{path:'/search',component:Search},
		{path:'/news/list',component:NewsList},
		{path:'/news/info/:id',component:NewsInfo},
		{path:'/photo/list',component:PhotoList},
		{path:'/photo/info',component:PhotoInfo},
	],
	linkActiveClass:'mui-active'
})

export default router